from django.db import models

# Create your models here.
from django.db import models


class Supply(models.Model):
    created = models.DateTimeField('创建时间', auto_now_add=True)
    created.editable = True
    name = models.CharField('姓名', max_length=12, blank=False)
    phone = models.CharField('手机', max_length=20, blank=False)
    email = models.CharField('邮箱', max_length=20, blank=True)
    type = models.CharField('供货类别', max_length=50, blank=False)
    company_name = models.CharField('公司名称', max_length=50, blank=False)
    local = models.CharField('详细地址', max_length=100, blank=True)
    summary = models.CharField('产品描述', max_length=100, blank=False)

    class Meta:
        ordering = ('created',)
        verbose_name = '供货'
        verbose_name_plural = '供货'

    def __str__(self):
        return '%s' % self.name


class Join(models.Model):
    created = models.DateTimeField('创建时间', auto_now_add=True)
    created.editable = True
    name = models.CharField('姓名', max_length=12, blank=False)
    phone = models.CharField('手机', max_length=20, blank=False)
    sex = models.CharField('性别', max_length=5, blank=True)
    email = models.CharField('邮箱', max_length=20, blank=True)
    city = models.CharField('所在城市', max_length=100, blank=True)
    company_name = models.CharField('公司名称', max_length=50, blank=False)
    local = models.CharField('详细地址', max_length=100, blank=True)
    education = models.CharField('学历', max_length=50, blank=False)
    school_name = models.CharField('毕业院校', max_length=50, blank=True)

    class Meta:
        ordering = ('created',)
        verbose_name = '加盟'
        verbose_name_plural = '加盟'

    def __str__(self):
        return '%s' % self.name


class Customized(models.Model):
    created = models.DateTimeField('创建时间', auto_now_add=True)
    created.editable = True
    name = models.CharField('姓名', max_length=12, blank=False)
    phone = models.CharField('手机', max_length=20, blank=False)
    email = models.CharField('邮箱', max_length=20, blank=True)
    duty = models.CharField('职责', max_length=20, blank=False)
    students_num = models.CharField('学生群体大小', max_length=20, blank=False)
    school_name = models.CharField('学校或机构名称', max_length=30, blank=False)
    school_type = models.CharField('学校或机构类型', max_length=30, blank=False)
    info = models.CharField('其他信息', max_length=100, blank=True)

    class Meta:
        ordering = ('created',)
        verbose_name = '定制'
        verbose_name_plural = '定制'

    def __str__(self):
        return '%s' % self.name


class HomeForm(models.Model):
    created = models.DateTimeField('创建时间', auto_now_add=True)
    created.editable = True
    name = models.CharField('姓名', max_length=12, blank=False)
    company_name = models.CharField('公司', max_length=50, blank=False)
    phone = models.CharField('手机', max_length=20, blank=False)
    email = models.CharField('邮箱', max_length=20, blank=True)

    class Meta:
        ordering = ('created',)
        verbose_name = '咨询'
        verbose_name_plural = '咨询'

    def __str__(self):
        return '%s' % self.name
